package com.yunhe.merchants.repository;

import com.yunhe.merchants.model.DataProjectCondition;
import org.apache.ibatis.annotations.Param;
import com.yunhe.merchants.domain.DataProject;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 经理项目池与公共商机库
 * @author hetao
 * @date 2021/05/10
 */
@Repository
public interface IDataProjectRepository {

    /**
     * 新增
     * @author hetao
     * @date 2021/05/10
     **/
    int createDataProject(DataProject dataProject);

    /**
     * 新增
     * @author hetao
     * @date 2021/05/10
     **/
    int createDataProjectSelective(DataProject dataProject);

    /**
     * 刪除
     * @author hetao
     * @date 2021/05/10
     **/
    int deleteDataProjectByPrimaryKey(@Param("id") String id);

    /**
     * 更新
     * @author hetao
     * @date 2021/05/10
     **/
    int updateDataProjectByPrimaryKey(DataProject dataProject);

    /**
     * 更新
     * @author hetao
     * @date 2021/05/10
     **/
    int updateDataProjectByPrimaryKeySelective(DataProject dataProject);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/05/10
     **/
    DataProject searchDataProjectByPrimaryKey(@Param("id") String id);

    List<DataProject> findProjectByConditionWithOutKeyWords(DataProjectCondition dataProjectCondition);

    List<DataProject> findProjectByConditionWithCustTel(DataProjectCondition dataProjectCondition);

    List<DataProject> findProjectByConditionWithCustName(DataProjectCondition dataProjectCondition);

    List<DataProject> findProjectByConditionWithCompanyName(DataProjectCondition dataProjectCondition);

    List<DataProject> getDataProejctByIds(@Param("ids") List<String> ids);

    void updateDataProjectByIds(@Param("ids") List<String>  ids,@Param("projectStatus") String projectStatus,
                                @Param("dataType") String dataType,@Param("updateTime") Date updateTime,@Param("updater") Long updater);

    void insertBatch(@Param("dataProjects") List<DataProject> dataProjects);

    List<DataProject> searchAll();

    void updateDataProjectByPlanId(DataProject dataProject);

    void updateIsDeleteBId(@Param("id") String id,@Param("updater") Long headerUser);

    void updateDataProject(DataProject dataProject);
}
